﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebClass;

namespace QuerySelectionLabelingTool
{
    public partial class Admin : System.Web.UI.Page
    {
        CoverageOperation coverageOper = new CoverageOperation();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            string s = ((LinkButton)sender).Text;
            int taskID = Convert.ToInt32(((LinkButton)sender).CommandArgument.ToString());
            if (s == "Ping Bing")
            {
                ((LinkButton)sender).Text = "Cancel";
                coverageOper.TriggerEvent(taskID);
            }
            else
            {
                ((LinkButton)sender).Text = "Ping Bing";
                coverageOper.DeleteTaskIDInQueue(taskID);
            }
            this.GridView1.DataBind();
        }
    }
}